package com.sxt.b_work;

import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * Created with IntelliJ IDEA.
 *
 * @Auther: 雷哥
 * @Date: 2020/10/07/1:08
 * @Description:
 */
@Component
public class WorkConsumer {

  /*
  第一个消费者
   */
  @RabbitListener(queuesToDeclare = {@Queue("work")})
  public void receive1(String message){
    System.out.println("接收到消息【1】:"+message);
  }

  /*
 *第二个消费者
  */
  @RabbitListener(queuesToDeclare = {@Queue("work")})
  public void receive2(String message){
    System.out.println("接收到消息【2】:"+message);
  }

}
